<?php
Yii::app()->clientScript->registerScriptFile($this->adminPath."/js/art-dialog/jquery.artDialog.js",CClientScript::POS_HEAD);
Yii::app()->clientScript->registerScriptFile($this->adminPath."/js/art-dialog/plugins/iframeTools.js",CClientScript::POS_HEAD);
Yii::app()->clientScript->registerScriptFile($this->adminPath."/js/jquery-ui-1.8.11.custom.min.js",CClientScript::POS_HEAD);
?>
    <link rel="stylesheet" type="text/css" href="<?php echo $this->adminPath; ?>/css/jquery-ui.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo $this->adminPath; ?>/js/art-dialog/skins/blue.css" />
    <!-- page title -->
    <div class="page-title" style="z-index: 780;">
        <div class="in" style="z-index: 770;">
            <div class="titlebar" style="z-index: 760;">
                <h2 class="title">首页幻灯片管理</h2><p>更改，删除首页幻灯片。</p></div>

            <div class="clear" style="z-index: 740;"></div>
        </div>
    </div>
    <style>
        .grid-view {
            padding: 0;
        }
        table.tablesorters {
            background-color: #CDCDCD;
            font-family: arial;
            font-size: 12px;
            margin: 0 0;
            text-align: left;
            width: 100%;
        }
        table.tablesorters thead tr th {
            background-position: right center;
            background-repeat: no-repeat;
            color: #333333;
            cursor: pointer;
        }
        table.tablesorters tbody td {
            padding: 12px;
            vertical-align: middle;
        }
        table.tablesorters tbody td {
            border: 1px solid #D8E4E9;
            color: #6C7D8C;
            padding: 12px;
            vertical-align: top;
        }
        table.tablesorters thead tr th, table.tablesorter tfoot tr th {
            -moz-border-bottom-colors: none;
            -moz-border-left-colors: none;
            -moz-border-right-colors: none;
            -moz-border-top-colors: none;
            background: url("<?php echo $this->adminPath; ?>/img/tableshorter/titlebg.png") repeat-x scroll center bottom #EFF3F8;
            border-color: -moz-use-text-color #CBDAE8;
            border-image: none;
            border-left: 1px solid #CBDAE8;
            border-right: 1px solid #CBDAE8;
            border-style: none solid;
            border-width: medium 1px;
            font-size: 8pt;
            padding: 12px;
        }
        table.tablesorters tbody tr.odd {
            background-color: #FFFFFF;
        }
        table.tablesorters tbody tr:hover {
            background-color: #E4ECF3;
        }
        .newLoding{
            background: url("<?php echo $this->adminPath; ?>/img/loading/6.gif") no-repeat scroll center bottom #EFF3F8;
        }
        .page.selected a{
            background:#3E7CAC ;
            color:#FFFFFF;
        }
        .grid-view .button-column {
            text-align: center;
            width: 30px;
        }
    </style>

    <div class="content">
        <div style="z-index: 650;" class="st-form-line">
            <div class="shortcuts-icons"  style="float:right">
                <a class="icon-button" id="idd" href="javascript:void(0);"><img width="18" height="18" alt="icon" src="<?php echo $this->adminPath; ?>/img/icons/button/create.png"><span>新增幻灯片</span></a>
            </div>
            <div style="z-index: 640;" class="clear"></div>
        </div>
        <div style="z-index: 500;" class="simplebox grid740">
            <div style="z-index: 490;" class="titleh">
                <h3>幻灯片列表</h3>
            </div>
            <?php if($info_array){ ?>
            <div class="grid-view" id="wx-reply-grid" style="width:960px">
                <table class="tablesorters">
                    <thead>
                    <tr>
                        <th id="wx-reply-grid_c0">图片</th>
                        <th id="wx-reply-grid_c1">标题</th>
                        <th id="wx-reply-grid_c2">排序</th>
                        <th id="wx-reply-grid_c3">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach($info_array as $k=>$v){ ?>
                    <tr class="odd">
                        <td>
                        <img style="width: 100px" width="100" src="<?php echo Yii::app()->params['imgPath'].$v['thumb']; ?>">
                        </td>
                        <td style="width:50px;text-align: center;">
                        <?php echo CHtml::decode($v['title']); ?>
                        </td>
                        <td style="width:90px;text-align: center;">
                        <?php echo intval($v['listorder']); ?>
                        </td>
                        <td style="width:100px;">
                            <a title="修改" onclick="renderUpdate(<?php echo $k; ?>)" href="javascript:void(0);">修改</a>|
                            <a title="删除" onclick="renderDelete(<?php echo $k; ?>)" href="javascript:void(0);">删除</a>
                        </td>
                    </tr>
                    <?php } ?>
                    </tbody>
                </table><div title="/uuzhoumo/admin/pick/index/" style="display:none" class="keys"><span>42</span></div>
            </div>
            <?php } ?>
        </div>

    </div>
<?php
Yii::app()->clientScript->registerScript('add',"
    function renderUpdate(id){
        art.dialog.open(
        '".Yii::app()->createAbsoluteUrl("admin/front/flashUpdate")."'+'id/'+id,
        {
            title:'修改',
            lock: true,
            width: 600,
            height: 500
        });
    }
    function renderDelete(id){
        if(confirm('本操作不可恢复，确定继续？')){
            $.ajax({
                type:'POST',
                url: '".Yii::app()->createAbsoluteUrl('admin/front/flashDelete')."'+'id/'+id,
                data:{},
                dataType:'json',
                beforeSend:function(){
                    art.dialog.Talert('正在删除数据ing', 5);
                },
                success:function(e){
                    if(e.status ==1){
                        art.dialog.Talert(e.message, 2);
                        window.location.reload();
                    }else{
                        art.dialog.Talert(e.message, 2);
                        return false;
                    }
                }
            });
        }
    }
        $(function(){
            $('#idd').click(function(){
                art.dialog.open(
                '".Yii::app()->createAbsoluteUrl("admin/front/flashAdd")."',
                {
                    title:'新增幻灯片',
                    lock: true,
                    width: 600,
                    height: 400
                });
            })
        });
    ",CClientScript::POS_END);

?>